<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html; charset=iso-8859-1" language="java"  errorPage="" %>
<jsp:directive.page import="cbm.commons.SessionContainer"/>
<jsp:directive.page import="cbm.commons.ConstantsWeb"/>
<jsp:directive.page import="cbm.commons.ResultadoOperacionBean"/>
<%
	SessionContainer sc = (SessionContainer)session.getAttribute(ConstantsWeb.SESSION_CONTAINER);
	ResultadoOperacionBean resultadoOPeracion =   (ResultadoOperacionBean)sc.getTemporalElement(ConstantsWeb.RESULTADO_OPERACION);
%>
<html>
<head>
<title>Continuidad Banca Minorista</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/estilos.css"/>
<script src="<%=request.getContextPath() %>/js/util/utiles.js" language="javascript"></script>
<script src="<%=request.getContextPath() %>/js/util/utf8.js"  language="javascript"></script>
<script src="<%=request.getContextPath() %>/js/util/prototype.js"  language="javascript"></script>
<script src="<%=request.getContextPath() %>/js/util/util_popup.js"  language="javascript"></script>

<script language="JavaScript">
	var myGlobalHandlers = {
		onCreate: function(){
			Element.show('systemWorking');
		},

		onComplete: function() {
			if(Ajax.activeRequestCount == 0){
				Element.hide('systemWorking');
			}
		}
	};
	Ajax.Responders.register(myGlobalHandlers);
	
</script>


<script type="text/javascript">

	function f_buscar(){
		$('btnBuscar').disabled;
		var pars = $('form1').serialize();
		var action = '<%=request.getContextPath()%>/usuario.do?method=buscar'
		
		var myAjax = new Ajax.Updater(
			$('detalle'),
			action, 
			{ 
				method: 'post',
				parameters: pars
			}
		);
		$('btnBuscar').enabled;
	}
	
	function f_limpiar(){
		document.forms[0].reset();
	}
	
	function f_nuevo(){
		var params = "dialogHeight:195px;dialogWidth:600px;center:yes;help:no;resizable:no";
		var url    = "<%=request.getContextPath()%>/usuario.do?method=openMantenimiento";
		open_popup(url, params);
	}
	
	function f_modificar(codigoUsuario){
		var params = "dialogHeight:195px;dialogWidth:600px;center:yes;help:no;resizable:no";
		var url    = "<%=request.getContextPath()%>/usuario.do?method=openMantenimiento&codigoUsuario="+codigoUsuario;
		open_popup(url, params);
	}
	
	function f_eliminar(codigoUsuario){
		var f = document.forms[0];
		f.hidCodigoUsuario.value  = codigoUsuario;
		
		var pars = $('form1').serialize();
		var action = '<%=request.getContextPath()%>/usuario.do?method=eliminar'
		
		var myAjax = new Ajax.Updater(
			$('detalle'),
			action, 
			{ 
				method: 'post',
				parameters: pars
			}
		);
	}
	
</script>	

</head>
<body>

			
<form name="form1" id="form1" method="post" action="<%=request.getContextPath()%>/usuario.do?method=buscar">
	<input type="hidden" name="hidCodigoUsuario" id="hidCodigoUsuario"  value=""/>
<table width="100%" align="center" height="100%">
	<tr>
		<td valign="top" height="140px">
			<div id="maestro">
				<table align="center" cellspacing="3" class="table3" width="100%">
					<tr>
						<td colspan="4" class="cuadrotitle">I. Gestionar Usuarios</td>
					</tr>
					<tr>
						<td>
							<table>
								<tr class="cuadrocontent">
									<td class="tcelda1" width="175">Registro</td>
									<td width="175">
										<input type="text" 
											name="txtNumeroRegistro" 
											id="txtNumeroRegistro" 
											class="input" />
									</td>
									<td class="tcelda1" width="175">Puesto</td>
									<td width="175">
										<select name="selPuesto" id="selPuesto" tabindex="6" class="combo">
											<option value="">[Seleccione]</option>
											<c:forEach items="${perfiles}" var="item" varStatus="status">
												<option value="${item.codigoperfil}" >
													<c:out value="${item.descripcionperfil}"/>
												</option>
											</c:forEach>
										</select>
									</td>
								</tr>
								<tr class="cuadrocontent">
									<td class="tcelda1">Apellido paterno</td>
									<td><input type="text" name="txtApellidoPaterno" id="txtApellidoMaterno" class="input" value="" /></td>
									<td class="tcelda1">Estado</td>
									<td>
										<select name="selEstado" id="selEstado" class="combo">
											<option value="">[Seleccione]</option>
											<c:forEach items="${estadoregistro}" var="item" varStatus="status">
												<option value="${item.valornumericoentero}">
													<c:out value="${item.descripcion}"/>
												</option>
											</c:forEach>
										</select>
									</td>
								</tr>
								<tr class="cuadrocontent">
									<td class="tcelda1">Apellido materno</td>
									<td><input type="text" name="txtApellidoMaterno" id="txtApellidoMaterno" class="input" value="" />
									</td>
									<td class="tcelda1">Tel&eacute;fono</td>
									<td>
										<input type="text" name="txtTelefono" id="txtTelefono" class="input" readonly="readonly"/>
									</td>
								</tr>
								<tr class="cuadrocontent">
									<td class="tcelda1">Nombre</td>
									<td><input type="text" name="txtNombre" id="txtNombre" class="input" value="" />
									</td>
									<td class="tcelda1"></td>
									<td></td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
	<tr height="24px">
		<td align="center">
			<div id="botonera">
				<input type="button" value="Buscar"  name="btnBuscar" id="btnBuscar" onClick="javascript:f_buscar();" class="button1"/>
				<input type="button" value="Limpiar" name="btnlimpiar" id="btnlimpiar" onClick="javascript:f_limpiar();" class="button1"/>
				<input type="button" value="Nuevo"   name="btnNuevo" id="btnNuevo" onClick="javascript:f_nuevo();" class="button1"/>
			</div>
		</td>
	</tr>
	<tr>
		<td valign="top" width="100%">
			<div id="detalle">
				<table width="100%">
					<tr>
						<td >
							<table align="left" width="100%"  border="1" cellpadding="0" cellspacing="0" >
								<tr>
									<td class="tceldatabla1" width="95">Registro</td>
									<td class="tceldatabla1" width="95">Puesto</td>
									<td class="tceldatabla1" width="95">Estado</td>
									<td class="tceldatabla1" width="200">Nombre Completo</td>
									<td class="tceldatabla1" width="95">Tel&eacute;fono</td>
									<td class="tceldatabla1" width="30">&nbsp;</td>
									<td class="tceldatabla1" width="30">&nbsp;</td>
								</tr>
								<tr class="cuadrocontentGrilla">
									<td colspan="7" align="left" valign="top">No hay registros.</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</div>
	  </td>
	</tr>
</table>
</form>			
			
			

</body>
</html>
<%if(sc != null)sc.removeTemporales();%>